<script>
$(document).ready(function() {
	$("form#StoreOrderSagePage").submit(function() {
		var url_ = "<?php echo $html->url(array('plugin'=>'store','controller'=>'orders','action'=>'clear_basket')) ?>";
		$.ajax({
		  url: url_,
		  context: document.body,
		  success: function(data){
			var json = jQuery.parseJSON(data);
			if(json.cart.error == "true" ){					
				alert(json.cart.message);
				return false;
			}
		  }
		});
	});
});
</script>

<div class="content">
	<div id="left-column">
		<?php echo $this->element('left_column')?>		
	</div>

	<div class="right-store-column search-bg">
		<?php echo $this->element('search_more',array('plugin'=>'store'))?>
	</div>
		
	<div class="right-store-column">						
		<div class="storeProducts view">
			<?php echo $this->Form->create('StoreOrder',array('url'=>$this->data['StoreOrder']['PurchaseURL'],'id'=>'StoreOrderSagePage'));?>
			<table width="100%">
				<tr>
					<td align="center">
						<?php echo $html->image(HOST.'/pay_by_sage_page_logo.gif')?> 
						<?php echo $html->image(HOST.'/pay_by_pay_pal_logo.png')?>						
					</td>
				</tr>
				<tr>
					<td align="center">
						<?php echo __d('store','Please click the icon below to proceed to Sage Pay Secure Internet Shopping',true);?>
					</td>
				</tr>
				<tr>
					<td align="center">
						
						<input type="hidden" name="VPSProtocol" value="<?php echo $this->data['StoreOrder']['VPSProtocol']?>" />
						<input type="hidden" name="TxType" value="<?php echo $this->data['StoreOrder']['TxType']?>" />
						<input type="hidden" name="Vendor" value="<?php echo $this->data['StoreOrder']['Vendor']?>" />
						<input type="hidden" name="Crypt" value="<?php echo $this->data['StoreOrder']['Crypt']?>" />
						<input type="image" src="/img/store.moon/buttons_proceed_to_payment.png" style="border: none; padding: 0px; margin: 4px;" />
						
					</td>
				</tr>
			</table>
			<?php echo $this->Form->end()?>
		</div>
	</div>
</div>